package com.mhc.suzuki.service;

import com.mhc.haval.security.model.User;
import com.mhc.suzuki.bo.AuditCustomerBO;
import com.mhc.suzuki.bo.CustomerBO;
import com.mhc.suzuki.bo.CustomerInfoBO;
import com.mhc.suzuki.dal.model.CustomerDO;
import com.mhc.suzuki.exception.SuzukiCommonException;
import com.mhc.suzuki.model.bo.CreditQueryApplyBO;
import com.mhc.suzuki.model.bo.OrderListBO;
import com.mhc.suzuki.vo.OrderVO;
import com.subaru.common.query.PageResult;

import java.util.List;

/**
 * 订单信息业务类
 * Created by kanon on 2017/8/23.
 */
public interface OrderService {

    /**
     * 创建订单
     * @param creditQueryApplyBOList
     * @param terminalType
     * @param orderNo
     * @param user
     * @throws SuzukiCommonException
     */
    void addOrder(List<CreditQueryApplyBO> creditQueryApplyBOList, String terminalType, String orderNo, User user) throws SuzukiCommonException;

    /**
     * 根据员工Id获取订单分页列表
     * @param orderListBO
     * @return
     * @throws SuzukiCommonException
     */
    PageResult<OrderVO> queryOrderList(OrderListBO orderListBO);



    /**
     * 根据订单号查询主贷人信息
     * @param orderNo
     * @return
     * @throws SuzukiCommonException
     */
    CustomerInfoBO queryCustomerInfo(String orderNo) throws SuzukiCommonException;

    /**
     * 根据订单号查询共同购车人信息
     * @param orderNo
     * @return
     * @throws SuzukiCommonException
     */
    CustomerBO querySpouseInfo(String orderNo) throws SuzukiCommonException;


    /**
     * 根据订单号查询担保人信息
     * @param orderNo
     * @return
     * @throws SuzukiCommonException
     */
    List<CustomerDO> queryUnderwriter(String orderNo) throws SuzukiCommonException;

    /**
     * 共同购车人信息录入
     * @param orderNo
     * @param customerBO
     * @return
     * @throws SuzukiCommonException
     */

    boolean inputSpouseInfo(String orderNo, CustomerBO customerBO) throws SuzukiCommonException;

    /**
     * 担保人信息录入
     * @param orderNo
     * @param customerBOS
     * @return
     * @throws SuzukiCommonException
     */
    boolean inputUnderwriterInfo(String orderNo, List<CustomerBO> customerBOS) throws SuzukiCommonException;

    /**
     * 购车人信息录入
     * @param orderNo
     * @param customerInfoBO
     * @return
     * @throws SuzukiCommonException
     */
    void inputCustomerInfo(String orderNo, CustomerInfoBO customerInfoBO) throws SuzukiCommonException;

    /**
     * 修改订单状态
     * @param orderNo
     * @param orderStatus
     * @return
     * @throws SuzukiCommonException
     */
    Boolean  changeOrderStatus(String orderNo ,int orderStatus) throws SuzukiCommonException;

    /**
     * 查询并获取订单状态
     * @param orderNo
     * @return
     * @throws SuzukiCommonException
     */
    int selectOrderStatus(String orderNo) throws SuzukiCommonException;

    /**
     * 根据applyId获取审核页客户信息
     * @param applyId
     * @return
     */
    AuditCustomerBO getAuditCustomer(Long applyId) throws SuzukiCommonException;

    /**
     * 获取历史其他订单记录
     * @param orderListBO
     * @return
     */
    PageResult<OrderVO>  queryOtherOrderList(OrderListBO orderListBO);
}
